﻿#ifndef COMCHANGE_H
#define COMCHANGE_H

#include "confirmdevice.h"

#include <QMainWindow>
#include <QAbstractNativeEventFilter>
#include <Windows.h>
#include <dbt.h>
#include<QString>
#include<QWidget>
#include<QDebug>

class ComChange : public QMainWindow, public QAbstractNativeEventFilter
{
    Q_OBJECT
public:
    ComChange();
    // QAbstractNativeEventFilter interface
public:
    bool nativeEventFilter(const QByteArray &eventType, void *message, long *result) override;

signals:
    void openSerial();
    void closeSerial(QString port);

private:
    ConfirmDevice* m_ConfirmDevice=nullptr;
    
};

#define ComChangeRelease Singleton<ComChange>::Release()
#define ComChangeInstance Singleton<ComChange>::GetInstance()

#endif // COMCHANGE_H

